import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import User from '../components/User.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home,
    children:[
      {path:"/user",component:User}
    ]
  }
]

const router = new VueRouter({
  routes
})


// // 解决跳转同一地址报错问题
// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch(err => err)
// }
export default router
